﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        /*
             九九乘法表:双重for循环

             *
             **
             ***
             ****

             i    num(j 的最大值)
             0     1
             1     2
             2     3
             
             i + 1 = num
        */
        //for (var i = 1; i < 10; i++) {
        //    let star = '';
        //    for (var k = 1; k < i+1; k++) {
        //        star = star + (i + '*' + k + '='+i * k+' ');
        //    }
        //    console.log( star);
        //}
        for (var i = 1; i < 10; i++) {
            let star = '';
           
            //for (var j = 1 ; j < i; j++) {
            //    star = star + '       ';
            //}
            for (var k = i; k < 10; k++) {
                star = star + (k + '*' + (i) + '=' + ( i) * k + '  ');
            }
           
            console.log(star);
        }
    </script>
</body>
</html>